﻿using MediatR;
using RBAC.Domain.Service.Interfae;
using RBACDuYaJun.Api.Appliction.Command.UserCommand;

namespace RBACDuYaJun.Api.Appliction.CommandHandlers.UserHanders
{
    public class UserDelCommandHandler : IRequestHandler<UserDeleteCommand, int>
    {
        private readonly IUserService _userService;
        public UserDelCommandHandler(IUserService userService)
        {
            _userService = userService;
        }

        public async Task<int> Handle(UserDeleteCommand request, CancellationToken cancellationToken)
        {
            return await _userService.DelUser(request.UserId);
        }
    }
}
